package com.itheima.Service.Impl;

import com.itheima.Mapper.studentMapper;
import com.itheima.Pojo.Student;
import com.itheima.Service.studentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class studentServiceImpl implements studentService {

    @Autowired
    private studentMapper stuMapper;

    @Override
    public void deleteById(Integer id) {
        stuMapper.deleteById(id);
    }

    @Override
    public void update(Student student) {
        stuMapper.update(student);
    }

    @Override
    public List<Student> getAllStudent() {
        List<Student> list = stuMapper.selectAll();
        return list;
    }

    @Override
    public void addStudent(Student student) {
        stuMapper.insert(student);
    }
}
